Skip to content

fix: preserve SwiftPM resource bundle lookup in packaged app#2

Open
eggie-1988 wants to merge 1 commit intoHyperNoodlez:mainfrom
eggie-1988:fix/resource-bundle-launch-crash
Open

fix: preserve SwiftPM resource bundle lookup in packaged app#2
eggie-1988 wants to merge 1 commit intoHyperNoodlez:mainfrom
eggie-1988:fix/resource-bundle-launch-crash

Conversation

@eggie-1988
Copy link
Copy Markdown

Summary

Package the SwiftPM resource bundle in a way that still satisfies the generated Bundle.module lookup path used by the release executable.

Problem

The packaged DMG currently copies PhemyNative_PhemyNative.bundle only into:

Phemy.app/Contents/Resources/PhemyNative_PhemyNative.bundle

But the generated runtime accessor first probes:

Phemy.app/PhemyNative_PhemyNative.bundle

On a clean install that causes an immediate launch crash:

Fatal error: could not load resource bundle:
from /Applications/Phemy.app/PhemyNative_PhemyNative.bundle
or /Users/shivgarge/Kord-Native/.build/arm64-apple-macosx/release/PhemyNative_PhemyNative.bundle

Fix

After copying the resource bundle into Contents/Resources, also create an app-root symlink:

Phemy.app/PhemyNative_PhemyNative.bundle -> Contents/Resources/PhemyNative_PhemyNative.bundle

This keeps the normal packaged resource location while restoring compatibility with the generated accessor in release builds.

Validation

  • Reproduced the crash locally from the distributed app
  • Confirmed that adding the same app-root symlink makes the app launch normally
  • Updated scripts/create-dmg.sh so future packaged apps include that symlink automatically

Related

Closes #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS release app crashes on launch because packaged resource bundle is only copied under Contents/Resources

2 participants